<?php
session_start();
require_once("../model/PersonaDaoIMP.php");
require_once("../model/Persona.php");
$em = $_POST["email"];
$ps = $_POST["password"];
$p = new Persona();
$p->setEmail($em);
$p->setPassword($ps);
$pDao = new PersonaDaoIMP();
$user = $pDao->checkLogin($p);
if(!is_null($user)){
	echo "imprimir";
	echo $user->getNombres();
	//$_SESSION['user'] = new Persona();
	$_SESSION['userDao'] = serialize($pDao);
	$_SESSION['user'] = serialize($user);
	$_SESSION["cad"] = "funca";
	//echo $_SESSION['user']->getNombres()."<- sesion";
	header("Location: ../view/perfil.php"); 
}else{
	header("Location: ../view/indexError.php"); 
	   echo "<div class='bs-docs-example'>
        <div class='alert alert-error'>
          <strong>Su usuario o contraseña no existen</strong> 
        </div>
      </div>";
	echo "nada";
}

?>